package com.test.websample.mapper;

import com.test.websample.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    @Select("select * from USER where id = #{id}")
    public User getUserById(int id);

    @Select("select * from USER where name=#{name}")
    public User getUserByName(String name);

    @Insert("insert into USER(name, age, isAlive, password) values" +
            "(#{name}, #{age},#{isAlive},#{password})")
    public void addUser(String name, int age, boolean isAlive, String password);

}
